# -*- coding: utf-8 -*-
# @Time    : 2021/3/2 22:19
# @Author  : FangQianqian
# @File    : testXlwt.py
# @Software: PyCharm

import xlwt

# workbook = xlwt.Workbook(encoding="utf-8")    #创建工作表
# worksheet = workbook.add_sheet("sheet1")      #添加工作页
# worksheet.write(0,1,'hello')     #写入数据，第1行第2列单元格写入hello
# workbook.save('student.xls')

#九九乘法表
workbook = xlwt.Workbook(encoding="utf-8")    #创建工作表
worksheet = workbook.add_sheet("sheet1")      #添加工作页

for i in range(0,9):
    for j in range(0,i+1):
        worksheet.write(i,j,"%d * %d = %d"%(i+1,j+1,(i+1)*(j+1)))


workbook.save('九九乘法表.xls')